//
//  GMMessageRegisterView.m
//  GmallVIP
//
//  Created by yemeihua on 15/10/15.
//  Copyright © 2015年 yemeihua. All rights reserved.
//

#import "GVMessageRegisterView.h"
#import "GVIndexMessageCell.h"

@implementation GVMessageRegisterView

- (instancetype)init
{
    if(self = [super init])
    {
        CGFloat mainWidth = kScreenWidth - 18.0 - 18.0 - 48.0 - 24.0;

        _titlelabel = [[UILabel alloc] init];
        _titlelabel.textColor = [UIColor yc_colorWithUInt:0x006db8];
        _titlelabel.font = [GVIndexMessageCell messageContentFont];
        _titlelabel.preferredMaxLayoutWidth = mainWidth;
        _titlelabel.numberOfLines = 0;
        [self addSubview:_titlelabel];
        
        [_titlelabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.and.top.and.right.equalTo(@0);
        }];
        
        _imageView = [[UIImageView alloc] init];
        _imageView.contentMode = UIViewContentModeScaleAspectFill;
        _imageView.layer.masksToBounds = YES;
        [self addSubview:_imageView];
        
        _seeButton = [[UIButton alloc] init];
        _seeButton.backgroundColor = [UIColor whiteColor];
        _seeButton.layer.borderWidth = 1;
        _seeButton.layer.borderColor = [UIColor blackColor].CGColor;
        _seeButton.layer.cornerRadius = 4.0;
        _seeButton.layer.masksToBounds = YES;
        _seeButton.titleLabel.font = [UIFont systemFontOfSize:14];
        [_seeButton setTitle:@"掌柜须知" forState:UIControlStateNormal];
        [_seeButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self addSubview:_seeButton];
        
        [_seeButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.equalTo(@72);
            make.height.equalTo(@32);
            make.left.equalTo(_imageView);
            make.top.equalTo(_imageView.mas_bottom).offset(10);
        }];
        
        _registerButton = [[UIButton alloc] init];
        _registerButton.backgroundColor = [UIColor whiteColor];
        _registerButton.layer.borderWidth = 1;
        _registerButton.layer.borderColor = [UIColor blackColor].CGColor;
        _registerButton.layer.cornerRadius = 4.0;
        _registerButton.layer.masksToBounds = YES;
        _registerButton.titleLabel.font = [UIFont systemFontOfSize:14];
        [_registerButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [_registerButton setTitle:@"快速注册" forState:UIControlStateNormal];
        [self addSubview:_registerButton];
        
        [_registerButton mas_makeConstraints:^(MASConstraintMaker *make) {
            make.width.equalTo(@72);
            make.height.equalTo(@32);
            make.right.equalTo(self.imageView.mas_right);
            make.top.equalTo(_imageView.mas_bottom).offset(10);
        }];
    }
    return self;
}
@end
